//package com.hjw.config;
//
//import com.hjw.entity.Book;
//import com.hjw.entity.Hot;
//import com.hjw.entity.Type;
//import com.hjw.service.BookService;
//import com.hjw.service.HotService;
//import com.hjw.service.TypeService;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.redis.core.RedisTemplate;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.PostConstruct;
//import javax.annotation.Resource;
//import java.util.ArrayList;
//import java.util.List;
//import java.util.Map;
//import java.util.stream.Collectors;
//
///**
// * <p>Project:Academic - InitConfig<p>
// *
// * @author IvanWei玮 -- maste
// * @version 1.0
// * @DataTime 2025/4/12 22:32
// * @since 1.8
// */
//@Slf4j
//@Component
//public class InitConfig {
//
//    @Autowired
//    private TypeService typeService;
//    @Autowired
//    private BookService bookService;
//    @Autowired
//    private HotService hotService;
//    @Autowired
//    private RedisTemplate<String, Object> redisTemplate;
//
//    @PostConstruct
//    public void initHot(){
////        List<Hot> all = hotService.findAll();
////        Map<Integer, Hot> map =
////                all.stream().collect(Collectors.toMap(Hot::getId, hot -> hot));
////        redisTemplate.opsForHash().putAll("hot::", map);
////        log.info("初始化hot完成");
//    }
//
//
//    @PostConstruct
//    public void initType() {
//
//    }
//
//    @PostConstruct
//    public void initBook() {
////        List<Book> all = bookService.findAll();
////        Map<Integer, Book> bookMap = all.stream().collect(Collectors.toMap(Book::getId, book -> book));
////        redisTemplate.opsForHash().putAll("book::", bookMap);
////        bookService.findById(1);
////        log.info("初始化book完成");
//    }
//
//
//}
